package com.zut.yyzx.controller;

import com.zut.yyzx.pojo.Food;
import com.zut.yyzx.service.FoodService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/food")
@CrossOrigin
//"食品管理"
public class FoodController {
    @Resource
    private FoodService foodService;

    @GetMapping("/listFood")
    //"查询所有食品列表"
    public List<Food> listFood() throws Exception{
        return foodService.list();
    }
}
